package com.example.lexiangbackend.repository;

import com.example.lexiangbackend.entity.MusicCategory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface MusicCategoryRepository extends JpaRepository<MusicCategory, Long> {
    
    /**
     * 根据分类名称查找分类
     */
    Optional<MusicCategory> findByName(String name);
    
    /**
     * 检查分类名称是否存在
     */
    boolean existsByName(String name);
} 